<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="button" value="点击" id="btn">
    <span id="info" style="display: none;">你在<span id="count" style="color: #000;">5</span>秒后跳转</span>
    <script>
        //点击按钮后，计时5秒后跳转到01.html
        var btn = document.querySelector('#btn');
        btn.addEventListener('click', function () {
            //显示提示信息
            document.querySelector('#info').style.display = 'block';
            //开启定时器
            time = setInterval(function () {
                //页面中的次数刷新
                count--;
                document.querySelector('#count').innerHTML = count;
                //判断是不是5秒
                if (count == 0) {
                    //跳转页面
                    window.location.href = './06倒计时.html';
                    // window.location.='./06倒计时.html';
                }
            }, 1000)
        })
        var count = 5, time = null;
    </script>
</body>

</html>